JBoss Community Archive (Read Only)

Teiid 8.7

Executing a script file

To execute a script file "foo.groovy" in a directory "some/directory" in the interactive comamnd line tool, execute as following

. some/directory/foo.groovy

"foo.groovy" is read into current context of the shell as if you typed in the whole document. If your script only contained method calls, you can explicitly invoke the call to execute.

Full execute syntax may also be used, and is required outside of the interactive command line tool:

evaluate("some/directory/foo.groovy" as File) 

To execute the same file without entering interactive mode, run

./adminshell.sh . some/directory/foo.groovy

Parameters can be passed in as Java System properties. For example

./adminshell.sh -Dparam=value . some/directory/foo.groovy

Inside the script file, you can access these properties using System.getProperty

value = System.getProperty(“param”); // will return "value"
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 12:56:51 UTC, last content change 2014-04-16 16:39:58 UTC.